<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="com.cetc39.util.DateJsonValueProcessor"%>
<%@ page import="net.sf.json.JsonConfig"%>
<%@ page import="net.sf.json.JSONObject"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Home</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords"
	content="Modern Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript">
	
	 addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } 

</script>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel='stylesheet' type='text/css' />
<!-- Custom CSS -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!-- Graph CSS -->
<link href="css/lines.css" rel='stylesheet' type='text/css' />
<link href="css/font-awesome.css" rel="stylesheet">
<!-- jQuery -->
<script src="js/jquery.min.js"></script>
<!-- Nav CSS -->
<link href="css/custom.css" rel="stylesheet">
<!-- Metis Menu Plugin JavaScript -->
<script src="js/metisMenu.min.js"></script>
<script src="js/custom.js"></script>
<!-- Graph JavaScript -->
<script src="js/d3.v3.js"></script>
<script src="js/rickshaw.js"></script>
<style type="text/css">
.detail_test ul {
	list-style: none;
	margin-left: 0%
}

.detail_test li {
	float: left;
	margin-right: 9%
}

details summary::-webkit-details-marker {
	display: none;
}
</style>
<script type="text/javascript">

	function getNodeDetail(id) {
		openUrl = "nodeDetail?opcode=getNodeDetailForShow&node_id=" + id;
						var iWidth = 800; //弹出窗口的宽度;
						var iHeight = 690; //弹出窗口的高度;
						var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //获得窗口的垂直位置;
						var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置;
						window.open(openUrl, "", "height=" + iHeight + ", width=" + iWidth
								+ ", top=" + iTop + ", left=" + iLeft + ", resizable=yes, scrollbars=1, location=no");
	}
	
	function showHistory(id) {
		
		$("#"+id).slideToggle("slow");
	}
	
	function fun() {
		var id = $("#select1  option:selected").val();
		window.location.href = "findPlanById?opcode=forUpdate&id=" + id;
	}
</script>
</head>
<body>
	<div id="wrapper">
		<!-- Navigation -->
		<!-- left.jsp -->
		<jsp:include page="left.jsp"></jsp:include>
		<div id="page-wrapper">
			<div class="xs">
				<div class="well1 white">
					<h1 align="center">一级计划列表</h1>
				</div>
				<h3 align="center">计划信息</h3>
				<div id="firstplan">
					
					<table class="table">
						<tr>
							<th>计划编号</th>
							<td>${firstplan.plan_id }</td>
							<th>计划发布时间</th>
							<td>${fn:substring(firstplan.plan_issue, 0, 19) }</td>
							<th>计划最后编辑时间</th>
							<td>${fn:substring(firstplan.plan_lastedit, 0, 19) }</td>
						</tr>
						<tr>
							<th>计划开始创建时间</th>
							<td>${fn:substring(firstplan.plan_setstart, 0, 19) }</td>
							<th>计划版本</th>
							<td>V${firstplan.plan_version }</td>
							<th><span id="lasteditTh"></span></th>
							<td><span id="lastedit"></span></td>
							<th><span id="issueTH"></span></th>
							<td><span id="issue"></span></td>
						</tr>
					</table>
				</div>
				<br>
				<h3 align="center">节点信息</h3>
				<br>
				<div id="detail_div" class="detail_test" align="center">
					<br>
					<table class="table">
						<tr>	
							<th>序号</th>
							<th>点击查看历史版本</th>
							<th>节点状态</th>
							<th>节点描述</th>
							<th>节点开始时间</th>
							<th>节点结束时间</th>
							<th>节点版本</th>
							<th>操作</th>
						</tr>
						<%
							int count = 0;
						 %>
						<c:forEach var="node" items="${nodeList }">
							<c:choose>
								<c:when test="${node.updateornot==0 }">
									<tr>
										<td><%= ++count %></td>
										<td>
											<div onclick="showHistory(${node.id})">点击查看历史版本</div>
											<div id="${node.id }" class="history" style="display:none;">
												<table class="">
													<c:forEach var="n" items="${nodeList }">
															<c:if test="${n.updateornot==1 && n.node_number==node.node_number }">
																<tr>
																	<td style="font-style: italic;">历史版本</td>
																	<td style="font-style: italic;">版本：V${n.node_version }</td>
																	<td style="font-style: italic;">描述：${n.node_describe }</td>
																	<td style="font-style: italic;">
																	<button onclick="getNodeDetail(this.value)" value="${n.id }">查看详情</button></td>
																</tr>
															</c:if>
													</c:forEach>
												</table>
											</div>
										</td>
										<td>
											<c:choose>
												<c:when test="${node.status==0 }">
													未完成
												</c:when>
												<c:otherwise>
													已完成
												</c:otherwise>
											</c:choose>
										</td>
										<td>${node.node_describe }</td>
										<td>${fn:substring(node.node_starttime, 0, 10) }</td>
										<td>${fn:substring(node.node_endtime, 0, 10) }</td>
										<td>V${node.node_version }</td>
										
										<td>
											<button onclick="getNodeDetail(this.value)"  class="btn btn-primary" value="${node.id }">查看详情</button>
										</td>
									</tr>
								</c:when>
							</c:choose>
						</c:forEach>
					</table>
					
					<button onclick="window.location.href='accessOrNot?result=1&plan_id=${firstplan.id}'"  class="btn btn-primary">同意</button>
					<button onclick="window.location.href='accessOrNot?result=0&plan_id=${firstplan.id}'"  class="btn btn-primary">驳回</button>
					
				</div>
			</div>
		</div>
		<!-- copyright -->
		<div id="footer">
			<jsp:include page="copyright.jsp"></jsp:include>
		</div>
	</div>
	<!-- /#page-wrapper -->
	<!-- /#wrapper -->
	<!-- Bootstrap Core JavaScript -->
	<script src="js/bootstrap.min.js"></script>
</body>
</html>
